home *** CD-ROM | disk | FTP | other *** search
/ Trusted Irix /B 4.0.4 / Trusted-Irix B-4.0.1.iso / dist / eoe1.idb / etc / fstyp.z / fstyp
Text File  |  1992-04-03  |  723b  |  44 lines

  1. #! /bin/sh
  2. #    Copyright (c) 1984 AT&T
  3. #      All Rights Reserved
  4.  
  5. #    THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T
  6. #    The copyright notice above does not evidence any
  7. #    actual or intended publication of such source code.
  8.  
  9. #ident    "@(#)fstyp:fstyp.sh    1.2"
  10. #ident    "$Revision: 1.5 $"
  11. #
  12. #    Determine the fs identifier of a file system.
  13. #
  14. #!    chmod +x ${file}
  15.  
  16. if [ $# -ne 1 ]
  17. then
  18.     echo "Usage: fstyp special"
  19.     exit 1
  20. fi
  21.  
  22. if [ ! -r $1 ]
  23. then
  24.     echo "fstyp: cannot read <$1>"
  25.     exit 1
  26. fi
  27.  
  28. #
  29. #    Execute all heuristic functions in /etc/fstyp.d and
  30. #    return the fs identifier of the specified file system.
  31. #
  32.  
  33. for f in /etc/fstyp.d/*
  34. do
  35.     msg=`$f $1 2>&1`
  36.     if [ $? -eq 0 ]
  37.     then
  38.         echo ${msg}
  39.         exit 0
  40.     fi
  41. done
  42. echo "Unknown_fstyp"
  43. exit 1
  44.